package com.example.covid19.mapper;

import com.example.covid19.common.Dto.goodsDto;
import com.example.covid19.common.Dto.stDto;
import com.example.covid19.entity.Gstock;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author BaiZhengChun
 * @since 2022-11-30
 */
public interface GstockMapper extends BaseMapper<Gstock> {
    @Select("SELECT " +
            " gstock.*,  " +
            " manufacturer.*,  " +
            " picp.picpath " +
            "FROM " +
            " gstock " +
            " INNER JOIN " +
            " manufacturer " +
            " ON " +
            " gstock.isup = manufacturer.isup " +
            " INNER JOIN " +
            " picp " +
            " ON " +
            " gstock.picid = picp.picid " +
            "WHERE " +
            " gstock.picid = picp.picid "+
            " LIMIT #{pageNo}, #{pagesize} "
    )
    List<stDto> gooinfo(@Param("pageNo")Integer pageNo, @Param("pagesize")Integer pagesize);

}
